package com.sita.bike.persistence;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import com.sita.bike.persistence.Person;
import com.sita.bike.persistence.Credential;
import com.sita.bike.persistence.Friend;
import com.sita.bike.persistence.Tracks;
import com.sita.bike.persistence.Route;
import com.sita.bike.persistence.RouteData;
import com.sita.bike.persistence.BluetoothData;
import com.sita.bike.persistence.RtResourceEntity;
import com.sita.bike.persistence.RtBlacklistEntity;
import com.sita.bike.persistence.RtNoteEntity;
import com.sita.bike.persistence.CcDriverEntity;
import com.sita.bike.persistence.CcDriverTicketEntity;
import com.sita.bike.persistence.CcPassengerTicketEntity;
import com.sita.bike.persistence.GroupChatDetailEvent;
import com.sita.bike.persistence.GroupMember;
import com.sita.bike.persistence.TrendMember;

import com.sita.bike.persistence.PersonDao;
import com.sita.bike.persistence.CredentialDao;
import com.sita.bike.persistence.FriendDao;
import com.sita.bike.persistence.TracksDao;
import com.sita.bike.persistence.RouteDao;
import com.sita.bike.persistence.RouteDataDao;
import com.sita.bike.persistence.BluetoothDataDao;
import com.sita.bike.persistence.RtResourceEntityDao;
import com.sita.bike.persistence.RtBlacklistEntityDao;
import com.sita.bike.persistence.RtNoteEntityDao;
import com.sita.bike.persistence.CcDriverEntityDao;
import com.sita.bike.persistence.CcDriverTicketEntityDao;
import com.sita.bike.persistence.CcPassengerTicketEntityDao;
import com.sita.bike.persistence.GroupChatDetailEventDao;
import com.sita.bike.persistence.GroupMemberDao;
import com.sita.bike.persistence.TrendMemberDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig personDaoConfig;
    private final DaoConfig credentialDaoConfig;
    private final DaoConfig friendDaoConfig;
    private final DaoConfig tracksDaoConfig;
    private final DaoConfig routeDaoConfig;
    private final DaoConfig routeDataDaoConfig;
    private final DaoConfig bluetoothDataDaoConfig;
    private final DaoConfig rtResourceEntityDaoConfig;
    private final DaoConfig rtBlacklistEntityDaoConfig;
    private final DaoConfig rtNoteEntityDaoConfig;
    private final DaoConfig ccDriverEntityDaoConfig;
    private final DaoConfig ccDriverTicketEntityDaoConfig;
    private final DaoConfig ccPassengerTicketEntityDaoConfig;
    private final DaoConfig groupChatDetailEventDaoConfig;
    private final DaoConfig groupMemberDaoConfig;
    private final DaoConfig trendMemberDaoConfig;

    private final PersonDao personDao;
    private final CredentialDao credentialDao;
    private final FriendDao friendDao;
    private final TracksDao tracksDao;
    private final RouteDao routeDao;
    private final RouteDataDao routeDataDao;
    private final BluetoothDataDao bluetoothDataDao;
    private final RtResourceEntityDao rtResourceEntityDao;
    private final RtBlacklistEntityDao rtBlacklistEntityDao;
    private final RtNoteEntityDao rtNoteEntityDao;
    private final CcDriverEntityDao ccDriverEntityDao;
    private final CcDriverTicketEntityDao ccDriverTicketEntityDao;
    private final CcPassengerTicketEntityDao ccPassengerTicketEntityDao;
    private final GroupChatDetailEventDao groupChatDetailEventDao;
    private final GroupMemberDao groupMemberDao;
    private final TrendMemberDao trendMemberDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        personDaoConfig = daoConfigMap.get(PersonDao.class).clone();
        personDaoConfig.initIdentityScope(type);

        credentialDaoConfig = daoConfigMap.get(CredentialDao.class).clone();
        credentialDaoConfig.initIdentityScope(type);

        friendDaoConfig = daoConfigMap.get(FriendDao.class).clone();
        friendDaoConfig.initIdentityScope(type);

        tracksDaoConfig = daoConfigMap.get(TracksDao.class).clone();
        tracksDaoConfig.initIdentityScope(type);

        routeDaoConfig = daoConfigMap.get(RouteDao.class).clone();
        routeDaoConfig.initIdentityScope(type);

        routeDataDaoConfig = daoConfigMap.get(RouteDataDao.class).clone();
        routeDataDaoConfig.initIdentityScope(type);

        bluetoothDataDaoConfig = daoConfigMap.get(BluetoothDataDao.class).clone();
        bluetoothDataDaoConfig.initIdentityScope(type);

        rtResourceEntityDaoConfig = daoConfigMap.get(RtResourceEntityDao.class).clone();
        rtResourceEntityDaoConfig.initIdentityScope(type);

        rtBlacklistEntityDaoConfig = daoConfigMap.get(RtBlacklistEntityDao.class).clone();
        rtBlacklistEntityDaoConfig.initIdentityScope(type);

        rtNoteEntityDaoConfig = daoConfigMap.get(RtNoteEntityDao.class).clone();
        rtNoteEntityDaoConfig.initIdentityScope(type);

        ccDriverEntityDaoConfig = daoConfigMap.get(CcDriverEntityDao.class).clone();
        ccDriverEntityDaoConfig.initIdentityScope(type);

        ccDriverTicketEntityDaoConfig = daoConfigMap.get(CcDriverTicketEntityDao.class).clone();
        ccDriverTicketEntityDaoConfig.initIdentityScope(type);

        ccPassengerTicketEntityDaoConfig = daoConfigMap.get(CcPassengerTicketEntityDao.class).clone();
        ccPassengerTicketEntityDaoConfig.initIdentityScope(type);

        groupChatDetailEventDaoConfig = daoConfigMap.get(GroupChatDetailEventDao.class).clone();
        groupChatDetailEventDaoConfig.initIdentityScope(type);

        groupMemberDaoConfig = daoConfigMap.get(GroupMemberDao.class).clone();
        groupMemberDaoConfig.initIdentityScope(type);

        trendMemberDaoConfig = daoConfigMap.get(TrendMemberDao.class).clone();
        trendMemberDaoConfig.initIdentityScope(type);

        personDao = new PersonDao(personDaoConfig, this);
        credentialDao = new CredentialDao(credentialDaoConfig, this);
        friendDao = new FriendDao(friendDaoConfig, this);
        tracksDao = new TracksDao(tracksDaoConfig, this);
        routeDao = new RouteDao(routeDaoConfig, this);
        routeDataDao = new RouteDataDao(routeDataDaoConfig, this);
        bluetoothDataDao = new BluetoothDataDao(bluetoothDataDaoConfig, this);
        rtResourceEntityDao = new RtResourceEntityDao(rtResourceEntityDaoConfig, this);
        rtBlacklistEntityDao = new RtBlacklistEntityDao(rtBlacklistEntityDaoConfig, this);
        rtNoteEntityDao = new RtNoteEntityDao(rtNoteEntityDaoConfig, this);
        ccDriverEntityDao = new CcDriverEntityDao(ccDriverEntityDaoConfig, this);
        ccDriverTicketEntityDao = new CcDriverTicketEntityDao(ccDriverTicketEntityDaoConfig, this);
        ccPassengerTicketEntityDao = new CcPassengerTicketEntityDao(ccPassengerTicketEntityDaoConfig, this);
        groupChatDetailEventDao = new GroupChatDetailEventDao(groupChatDetailEventDaoConfig, this);
        groupMemberDao = new GroupMemberDao(groupMemberDaoConfig, this);
        trendMemberDao = new TrendMemberDao(trendMemberDaoConfig, this);

        registerDao(Person.class, personDao);
        registerDao(Credential.class, credentialDao);
        registerDao(Friend.class, friendDao);
        registerDao(Tracks.class, tracksDao);
        registerDao(Route.class, routeDao);
        registerDao(RouteData.class, routeDataDao);
        registerDao(BluetoothData.class, bluetoothDataDao);
        registerDao(RtResourceEntity.class, rtResourceEntityDao);
        registerDao(RtBlacklistEntity.class, rtBlacklistEntityDao);
        registerDao(RtNoteEntity.class, rtNoteEntityDao);
        registerDao(CcDriverEntity.class, ccDriverEntityDao);
        registerDao(CcDriverTicketEntity.class, ccDriverTicketEntityDao);
        registerDao(CcPassengerTicketEntity.class, ccPassengerTicketEntityDao);
        registerDao(GroupChatDetailEvent.class, groupChatDetailEventDao);
        registerDao(GroupMember.class, groupMemberDao);
        registerDao(TrendMember.class, trendMemberDao);
    }
    
    public void clear() {
        personDaoConfig.getIdentityScope().clear();
        credentialDaoConfig.getIdentityScope().clear();
        friendDaoConfig.getIdentityScope().clear();
        tracksDaoConfig.getIdentityScope().clear();
        routeDaoConfig.getIdentityScope().clear();
        routeDataDaoConfig.getIdentityScope().clear();
        bluetoothDataDaoConfig.getIdentityScope().clear();
        rtResourceEntityDaoConfig.getIdentityScope().clear();
        rtBlacklistEntityDaoConfig.getIdentityScope().clear();
        rtNoteEntityDaoConfig.getIdentityScope().clear();
        ccDriverEntityDaoConfig.getIdentityScope().clear();
        ccDriverTicketEntityDaoConfig.getIdentityScope().clear();
        ccPassengerTicketEntityDaoConfig.getIdentityScope().clear();
        groupChatDetailEventDaoConfig.getIdentityScope().clear();
        groupMemberDaoConfig.getIdentityScope().clear();
        trendMemberDaoConfig.getIdentityScope().clear();
    }

    public PersonDao getPersonDao() {
        return personDao;
    }

    public CredentialDao getCredentialDao() {
        return credentialDao;
    }

    public FriendDao getFriendDao() {
        return friendDao;
    }

    public TracksDao getTracksDao() {
        return tracksDao;
    }

    public RouteDao getRouteDao() {
        return routeDao;
    }

    public RouteDataDao getRouteDataDao() {
        return routeDataDao;
    }

    public BluetoothDataDao getBluetoothDataDao() {
        return bluetoothDataDao;
    }

    public RtResourceEntityDao getRtResourceEntityDao() {
        return rtResourceEntityDao;
    }

    public RtBlacklistEntityDao getRtBlacklistEntityDao() {
        return rtBlacklistEntityDao;
    }

    public RtNoteEntityDao getRtNoteEntityDao() {
        return rtNoteEntityDao;
    }

    public CcDriverEntityDao getCcDriverEntityDao() {
        return ccDriverEntityDao;
    }

    public CcDriverTicketEntityDao getCcDriverTicketEntityDao() {
        return ccDriverTicketEntityDao;
    }

    public CcPassengerTicketEntityDao getCcPassengerTicketEntityDao() {
        return ccPassengerTicketEntityDao;
    }

    public GroupChatDetailEventDao getGroupChatDetailEventDao() {
        return groupChatDetailEventDao;
    }

    public GroupMemberDao getGroupMemberDao() {
        return groupMemberDao;
    }

    public TrendMemberDao getTrendMemberDao() {
        return trendMemberDao;
    }

}
